package cn.luischen.controller.admin;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
import cn.luischen.utils.APIResponse;
import cn.luischen.service.user.UserService;
import org.springframework.web.bind.annotation.GetMapping;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.ResponseBody;

import org.powermock.reflect.Whitebox;
import org.mockito.Mock;
import static org.junit.Assert.fail;
import org.junit.runner.RunWith;
import java.util.HashMap;
import java.util.ArrayList;
import org.mockito.MockitoAnnotations;
import com.alibaba.fastjson.JSONArray;
import org.junit.After;
import org.powermock.core.classloader.annotations.PrepareForTest;
import java.util.Map;
import static org.junit.Assert.assertEquals;
import org.powermock.modules.junit4.PowerMockRunner;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PowerMockIgnore;
import java.lang.reflect.Method;
import org.junit.rules.ExpectedException;
import org.mockito.InjectMocks;
import org.junit.Test;
import static org.junit.Assert.*;
import com.unitspirit.runtime.*;
import org.mockito.Mockito;
import java.util.List;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import org.junit.Rule;
import static org.junit.Assert.assertNotNull;
import static org.mockito.ArgumentMatchers.*;
import static org.mockito.Mockito.*;
import static org.junit.Assert.assertTrue;
import com.alibaba.fastjson.parser.ParserConfig;

/**
* The class <code>UserControllerTest</code> contains tests for the class <code>{@link UserController}</code>.
* Copyright (c) 2020
* 
* @generatedBy UnitSpirit at 2021-09-07 17:51:41
* @version 1.0.20210903
*/

@PowerMockIgnore({ "javax.management.*" })
@RunWith(PowerMockRunner.class)
@PrepareForTest({ cn.luischen.utils.APIResponse.class })
public class UserController_dockerTest_WGTest {

	@InjectMocks
	cn.luischen.controller.admin.UserController unitspirit_fixture;
	@Mock
	cn.luischen.service.user.UserService mock_UserService;

	@Rule
	public ExpectedException unitspirit_thrown = ExpectedException.none();

	/**
	* 测试方法初始化.
	* 
	* @throws Exception 
	*         if the initialization fails for some reason 
	*  
	* @generatedBy UnitSpirit at 2021-09-07 17:51:41
	*/
	@org.junit.Before
	public void setUp() throws Exception {
		try {
			GlobalUnitInit.init();
			MockitoAnnotations.initMocks(this);
			ParserConfig.getGlobalInstance().setAutoTypeSupport(true);
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}

	/**
	* @date 2021-09-07 17:51:42
	* @see cn.luischen.controller.admin.UserController#dockerTest
	* @category auto generate by UnitSpirit  
	* @author UnitSpirit   
	*/
	@Test
	public void test_dockerTest_20210722_100105_201_1_01() throws Throwable {
		//成员变量设置

		//返回值定义 
		String result_expected = "{\"code\":\"success\",\"data\":\"hello docker\"}";

		PowerMockito.mockStatic(cn.luischen.utils.APIResponse.class);
		cn.luischen.utils.APIResponse mock_result_APIResponse1 = JSON
				.parseObject("{\"code\":\"success\",\"data\":\"hello docker\"}", cn.luischen.utils.APIResponse.class);

		PowerMockito.when(cn.luischen.utils.APIResponse.success(anyObject())).thenReturn(mock_result_APIResponse1);

		cn.luischen.utils.APIResponse<java.lang.String> unitspirit_result = unitspirit_fixture.dockerTest();
		UnitAssert.assertEquals(result_expected, UnitSpiritFastJsonUtil.getJsonString2(unitspirit_result));
	}
}
